Wear leveling in solid state devices

ABSTRACT

Embodiments of the present disclosure provide a memory-efficient mechanism for identifying memory blocks with a low wear count. More particularly, embodiments of the present disclosure provide a mechanism for identifying a memory block whose wear count is within the bottom p % of all wear counts associated with memory blocks in a storage system. If a memory controller performs the garbage collection operation on a memory block whose wear count is within the bottom p % of all wear counts, then the memory controller is expected to utilize the remaining memory blocks (e.g., memory blocks whose wear count is within the upper (100-p)% of all wear counts) efficiently and level the wear count of at least the remaining memory blocks.

CROSS-REFERENCE TO RELATED APPLICATIONS

The present application is a continuation application of U.S.application Ser. No. 15/130,320, titled “Wear Leveling in Solid StateDevices,” filed Apr. 15, 2016, which is a continuation application ofU.S. application Ser. No. 14/509,400, titled “Apparatus, Systems, andMethods for Providing Wear Leveling in Solid State Devices,” filed Oct.8, 2014, each of the above applications being hereby expresslyincorporated herein by reference in their entirety.

BACKGROUND Field of the Disclosure

The present disclosure relates to apparatus, systems, and methods forproviding wear leveling in solid state devices.

Related Disclosure

Flash memory can include an improved form of Electrically-ErasableProgrammable Read-Only Memory (EEPROM). Traditional EEPROM devices areonly capable of erasing or writing one memory location (e.g., a memorycell) at a time. In contrast, flash memory allows multiple memorylocations to be erased or written in one programming operation. Flashmemory can thus operate at a higher speed compared to traditionalEEPROM.

Flash memory, which can also be referred to as a flash memory device ora flash storage device, has a number of advantages over other storagedevices. It generally offers faster read access times and better shockresistance than a hard disk drive (HDD). Unlike dynamic random accessmemory (DRAM), flash memory is non-volatile, meaning that data stored inflash memory is not lost when power to the memory is removed. Theseadvantages, and others, may explain the increasing popularity of flashmemory for storage applications in devices such as memory cards, USBflash drives, mobile phones, digital cameras, mass storage devices, MP3players and the like.

Current flash storage devices suffer from a number of limitations.Although a flash memory device can be read or written at the physicalpage level, it can only be erased or rewritten at the block level, whichincludes multiple physical pages. For example, beginning with apre-erased block, data can be written to any physical page within thatblock. However, once data has been written to a physical page, thecontents of that physical page cannot be changed or removed until theentire block containing that physical page is erased. In other words,while flash memory can support random-access read and write operations,it cannot support random-access rewrite or erase operations.

SUMMARY

Embodiments of the present disclosure relate to apparatus, systems, andmethods for providing wear leveling in solid state devices.

Some embodiments include a method. The method includes receiving, at amemory controller in a storage system coupled to a host device via aninterface, a request to remove data in any one of a plurality of memoryblocks in the storage system, selecting, by the memory controller, oneof the memory blocks in the storage system, and determining, by thememory controller, a wear count associated with the selected memoryblock, wherein the wear count is indicative of a number of times thememory block has been erased. When the wear count associated with theselected memory block is less than a threshold wear count, the methodincludes causing, by the memory controller, data to be removed from theselected memory block. When the wear count associated with the selectedmemory block is not less than the threshold wear count, the methodincludes selecting, by the memory controller, another one of the memoryblocks until the memory controller selects a memory block whose wearcount is less than the threshold wear count.

In some embodiments, the method further includes maintaining a wearcount table having a wear count element associated with a particularwear count, wherein the wear count element indicates a number of memoryblocks having the particular wear count.

In some embodiments, the method further includes determining thethreshold wear count based on the particular wear count associated withthe wear count table.

In some embodiments, the particular wear count is indicative of an upperbound of a bottom p % of all wear counts associated with the pluralityof memory blocks.

In some embodiments, the method further includes detecting a garbagecollection operation performed on one of the plurality of memory blocks;and increasing, by one, a wear count associated with the one of theplurality of memory.

In some embodiments, the method further includes determining a firstwear count element of the wear count table associated with a previouswear count of the one of the plurality of memory; determining a secondwear count element of the wear count table associated with the wearcount of the one of the plurality of memory; and when the first wearcount element and the second wear count element are different,decreasing a value of the first wear count element by one and increasinga value of the second wear count element by one.

In some embodiments, wherein the request to remove data in any one ofmemory blocks in the storage system comprises a request to perform agarbage collection operation.

In some embodiments, wherein when the memory controller is unable toidentify a memory block whose wear count is less than the threshold wearcount after a fixed number of iterations, randomly selecting a memoryblock for the garbage collection operation.

Some embodiments include a storage system. The storage system caninclude one or more storage devices comprising a plurality of memoryblocks for maintaining data. The storage system can also include amemory controller configured to process a request to remove data in anyone of memory blocks in the storage system. The memory controller can beconfigured to select one of the memory blocks in the storage system,determine a wear count associated with the selected memory block,wherein the wear count is indicative of a number of times the memoryblock has been erased. When the wear count associated with the selectedmemory block is less than a threshold wear count, the memory controllercan be configured to cause data to be removed from the selected memoryblock. When the wear count associated with the selected memory block isnot less than the threshold wear count, the memory controller can beconfigured to select another one of the memory blocks until the memorycontroller selects a memory block whose wear count is less than thethreshold wear count.

In some embodiments, the memory controller is configured to maintain awear count table having a wear count element associated with aparticular wear count, wherein the wear count element indicates a numberof memory blocks having the particular wear count.

In some embodiments, the memory controller is configured to determinethe threshold wear count based on the particular wear count associatedwith the wear count table.

In some embodiments, the particular wear count is indicative of a bottomp % of all wear counts associated with the plurality of memory blocks.

In some embodiments, the memory controller is configured to detect agarbage collection operation performed on one of the plurality of memoryblocks; and increase, by one, a wear count associated with the one ofthe plurality of memory.

In some embodiments, the memory controller is configured to determine afirst wear count element of the wear count table associated with aprevious wear count of the one of the plurality of memory; determine asecond wear count element of the wear count table associated with thewear count of the one of the plurality of memory; and when the firstwear count element and the second wear count element are different,decrease a value of the first wear count element by one and increasing avalue of the second wear count element by one.

In some embodiments, the request to remove data in any one of memoryblocks in the storage system comprises a request to perform a garbagecollection operation.

In some embodiments, when the memory controller is unable to identify amemory block whose wear count is less than the threshold wear countafter a fixed number of iterations, the memory controller is configuredto randomly select a memory block for the garbage collection operation.

Some embodiments include a non-transitory computer readable mediumhaving executable instructions. The executable instructions can beoperable to cause a memory controller in a storage system to receive arequest to remove data in any one of memory blocks in the storagesystem; select one of the memory blocks in the storage system; anddetermine a wear count associated with the selected memory block,wherein the wear count is indicative of a number of times the memoryblock has been erased. When the wear count associated with the selectedmemory block is less than a threshold wear count, the executableinstructions can be operable to cause a memory controller to cause datato be removed from the selected memory block. When the wear countassociated with the selected memory block is not less than the thresholdwear count, the executable instructions can be operable to cause amemory controller to select another one of the memory blocks until thememory controller selects a memory block whose wear count is less thanthe threshold wear count.

In some embodiments, the non-transitory computer readable medium furtherincludes executable instructions operable to cause the memory controllerto maintain a wear count table having a wear count element associatedwith a particular wear count, wherein the wear count element indicates anumber of memory blocks having the particular wear count.

In some embodiments, the non-transitory computer readable medium furtherincludes executable instructions operable to cause the memory controllerto determine the threshold wear count based on the particular wear countassociated with the wear count table.

BRIEF DESCRIPTION OF THE FIGURES

Various objects, features, and advantages of the disclosed subjectmatter can be more fully appreciated with reference to the followingdetailed description of the disclosed subject matter when considered inconnection with the following drawings, in which like reference numeralsidentify like elements. The accompanying figures are schematic and arenot intended to be drawn to scale. For purposes of clarity, not everycomponent is labeled in every figure. Nor is every component of eachembodiment of the disclosed subject matter shown where illustration isnot necessary to allow those of ordinary skill in the art to understandthe disclosed subject matter.

FIG. 1 illustrates an exemplary computing system 106 having a storagesystem in accordance with some embodiments of the present disclosure.

FIG. 2 illustrates a wear count table in accordance with someembodiments.

FIG. 3 illustrates a process of updating and maintaining a wear counttable in accordance with some embodiments.

FIG. 4 illustrates a process for selecting a memory block for a garbagecollection operation in accordance with some embodiments.

FIG. 5 illustrates a probability of identifying a memory block inaccordance with some embodiments.

DETAILED DESCRIPTION

In the following description, numerous specific details are set forthregarding the systems and methods of the disclosed subject matter andthe environment in which such systems and methods may operate, etc., inorder to provide a thorough understanding of the disclosed subjectmatter. It will be apparent to one skilled in the art, however, that thedisclosed subject matter may be practiced without such specific details,and that certain features, which are well known in the art, are notdescribed in detail in order to avoid complication of the disclosedsubject matter. In addition, it will be understood that the examplesprovided below are exemplary, and that it is contemplated that there areother systems and methods that are within the scope of the disclosedsubject matter.

Data can be written to a flash memory device in a unit called a page,which may include multiple memory cells. However, due to physicalcharacteristics of a flash memory device, data stored in the flashmemory device can only be erased in larger units called blocks, whichmay include multiple pages.

When data stored in a page is no longer needed—also referred to as astale page—a flash memory controller that manages the flash memory canperform a garbage collection (GC) operation, which involves erasing datafrom a block that includes the stale page. During GC, the flash memorycontroller can first retrieve valid data from pages in that block andre-write the retrieved valid data into another empty memory block.Subsequently, the flash memory controller can erase the data from theblock, and use the erased block for storing new data.

The problem with the GC is that flash memory cells can only beprogrammed and erased a limited number of times. The maximum number ofprogram/erase cycles that a flash memory cell can sustain is referred toas a P/E cycle. The P/E cycle of single-level cell (SLC) flash memory,designed for high performance and longer endurance, can typically bebetween 50,000 and 106,000 cycles. On the other hand, the P/E cycle ofmulti-level cell (MLC) flash memory, which is designed for lower costapplications, is typically between 3,000 and 5,000. The P/E cycle can beindicative of a lifetime of the flash memory cell. Therefore, a flashmemory controller is often designed to perform the GC operation in sucha way that all flash memory cells are as evenly used as possible.

To this end, a flash memory controller can maintain a wear count foreach memory block in a storage system. The wear count can indicate thenumber of erasures that have been performed on the memory block.Therefore, the flash memory controller can perform the GC operation tolevel the wear count across memory blocks in a storage system. Forexample, the controller can attempt to write data to physical pages in amemory block with a lower wear count, or the controller can attempt tofree-up (e.g., erase) memory blocks with a lower wear count.

Unfortunately, existing techniques for identifying memory blocks with alower wear count can consume a large amount of memory because they oftenuse special data structures to order the memory blocks based on theassociated wear counts. For example, existing techniques may use adouble linked list to order memory blocks based on the associated wearcounts so that the last node in the double linked list corresponds tothe memory block with the lowest wear count. However, maintaining adouble linked list can consume a large amount of memory, especially whena storage system maintains a large number of memory blocks.

Embodiments of the present disclosure provides a memory-efficientmechanism for identifying memory blocks with a low wear count. Moreparticularly, embodiments of the present disclosure provides a mechanismfor identifying a memory block whose wear count is within the bottom p %of all wear counts associated with memory blocks in a storage system. Ifa memory controller always performs the GC operation on a memory blockwhose wear count is within the bottom p % of all wear counts, then thememory controller is expected to utilize the remaining memory blocks(e.g., memory blocks whose wear count is within the upper (100−p) % ofall wear counts) efficiently and level the wear count of at least theremaining memory blocks. In fact, in some embodiments, the difference inthe wear counts between the remaining memory blocks can be as low asone.

In some embodiments, the memory controller is configured to maintain atable that indicates the threshold wear count representing the upperbound of the bottom p % of all wear counts. This table can be updatedwhen a GC operation is performed so that the table accurately reflectsthe threshold wear count.

When the memory controller receives a request to free-up a memory block(e.g., perform a GC operation), the memory controller can select amemory block whose wear count is within the bottom p % of all wearcounts. To this end, the memory controller can randomly select a memoryblock, and determine a wear count associated with the selected memoryblock. If the determined wear count is less than or equal to thethreshold wear count representing the upper bound of the bottom p % ofall wear counts, then the memory controller can perform the GC operationon the selected memory block. If the determined wear count is greaterthan the threshold wear count, then the memory controller can selectanother memory block and iterate this process until the memorycontroller identifies a memory block whose wear count is less than orequal to the threshold wear count. In some embodiments, the memorycontroller can be configured to limit the number of iterations foridentifying this memory block. This way, the memory controller does notstall the GC operation indefinitely, especially when the value of p islow. In some embodiments, when the memory controller fails to identify amemory block within the number of iterations, the memory controller canrandomly select a memory block for the garbage collection.

FIG. 1 illustrates an exemplary computing system 106 having a storagesystem in accordance with some embodiments of the present disclosure.The computing system 106 can include a host device 102 and a storagesystem 104, where the storage system 104 includes a memory controller106 and one or more storage devices 108 a-108 d. Each storage device 108can include a plurality of memory blocks 110A-110N for maintaining data.Each of the memory blocks 110 can have a fixed size. For example, amemory block 110 can be 128 KB long. Each memory block 110 can bedivided into a plurality of pages. Each page in the memory block 110 canhave a fixed size. For example, a page can be 4 KB long.

The host device 102 can include any computer system that uses andaccesses a storage system 104 for data read and data write operations.Such a host device 102 may run applications such as databases, filesystems, and web services. In some embodiments, the host device 102 canbe physically co-located with (e.g., located physically close to) thestorage system 104. In such embodiments, the host device 102 can beconfigured to communicate with the storage system 104 via a bus. The buscan include, for example, PCI, PCI-Express, PCI-X, InfiniBand,HyperTransport, SCSI PCI-E card, SATA PCI-E card, iSCSI adaptor card,and Fibre Channel PCI-E card. In other embodiments, the host device 102can be physically separated from the storage system 104. In suchembodiments, the host device 102 can communicate with the storage system104 via a communication network. The network can include the Internet, alocal area network (LAN), a packet data network, a legacy network, orany type of network that is capable of providing data communicationbetween the host device 102 and the storage system 104.

In some embodiments, a memory controller 106 is implemented in hardware.The hardware can include logic circuits and/or memory for selectingtarget memory blocks and for evicting data from the selected targetmemory blocks to accommodate new data. In some embodiments, the hardwarefor the memory controller 106 can be implemented using a hardwaredescription language including Verilog, VHSIC hardware descriptionlanguage (VHDL), and BlueSpec™ (Bluespec Inc., Framingham, Mass.), andbe synthesized using logic synthesis tools including Design Compiler®(Synopsis Inc., Mountain View, Calif.), Encounter RTL compiler (CadenceDesign Systems Inc., San Jose, Calif.), RealTime Designer (Oasys DesignSystems, Inc., Santa Clara, Calif.), and BooleDozer (InternationalBusiness Machine, Endicott, N.Y.).

In some embodiments, a memory controller 106 is implemented as a part offirmware. As discussed further below, the firmware can allocate a memoryspace for maintaining a wear count table and a wear count map, and canfurther include instructions operable to identify a memory block for aGC operation.

In some embodiments, the memory controller 106 can be implemented insoftware using memory such as a non-transitory computer readable medium,a programmable read only memory (PROM), or flash memory. The softwarecan run on a processor, which may reside in the memory controller 106,which executes instructions or computer code, which can be embodied in anon-transitory computer readable medium embodied in the memorycontroller 106.

In some embodiments, the storage device 108 can be implemented usinghard disk drives (HDDs). In other embodiments, the storage device 108can also be implemented using nonvolatile RAM (NVRAM), amicro-electromechanical systems (MEMS) storage, or a battery backeddynamic random access memory (DRAM).

In some embodiments, the memory controller 106 can receive a request toperform a GC operation to free-up a memory block 110 for a new set ofdata. To this end, the memory controller 106 is configured to select amemory block 110 for the GC operation. To level the wear counts amongstthe memory blocks 110 in the storage system 104, the memory controller106 can be configured to select a memory block 110 whose wear count islower compared to other memory blocks. More particularly, the memorycontroller 106 can be configured to select a memory block 110 whose wearcount is within the bottom p % of all wear counts.

To identify a memory block 110 whose wear count is within the bottom p %of all wear counts, the memory controller 106 can be configured tomaintain a wear count map. The wear count map can include a plurality ofwear count values, each of which indicates a wear count value for one ofthe memory blocks 110 in the storage system. The memory controller 106can also maintain a wear count table. The wear count table can indicatea number of memory blocks associated with a particular wear count or aparticular range of wear counts.

FIG. 2 illustrates a wear count table in accordance with someembodiments. FIG. 2 illustrates an exemplary scenario in which the totalnumber of memory blocks in the storage system 104 is 50,000, and allmemory blocks have a wear count between 2515 and 2517. The table 200includes three wear count elements 202A-202C, which are associated with2515, 2516, and 2517, respectively. The memory controller 106 can beconfigured to use this wear count table 200 to determine a thresholdwear count that represents the upper bound of the bottom p % of all wearcounts. For example, in FIG. 2, since the storage system 104 includes50,000 memory blocks, the memory controller 106 can determine that thewear count 2515 is the upper bound of the bottom 1% of all wear counts.

In some embodiments, the table 200 can also include a cumulativedistribution function (CDF) of the wear counts. The CDF can describe theprobability with which a memory block with a wear count that is lessthan or equal to a particular wear count can be found. The CDF can beindicative of the threshold wear count that represents the upper boundof the bottom p % of all wear counts.

In some embodiments, other types of data structures can be used torepresent the information in the wear count table. For example, theinformation can be represented using an array, a linked list, or anyother types of data structures that can maintain an association betweena wear count and the number of memory blocks having the associated wearcount.

The memory controller 106 can be configured to update the wear counttable 200 so that the table 200 can accurately reflect the thresholdwear count. FIG. 3 illustrates a process of updating and maintaining awear count table in accordance with some embodiments.

In step 302, the memory controller 106 can initialize the wear counttable 200. The wear count table 200 can include N wear count elements(e.g., N rows), each associated with a particular wear count or aparticular range of wear counts. The memory controller 106 can setvalues corresponding to the N wear count elements. The valuescorresponding to the N wear count elements can be the number of memoryblocks having the wear count associated with the wear count element.

In step 304, the memory controller 106 can detect a GC operation for amemory block 110 in the storage system 104. When the memory controller106 detects a GC operation, the memory controller 106 can proceed tostep 306. Until the memory controller 106 detects a GC operation, thememory controller 106 can remain in step 304.

In step 306, the memory controller 106 can update the wear count map toreflect the detected GC operation. For example, the memory controller106 can increase, by one, the wear count associated with the memoryblock stored in the wear count map. This way, the wear count mapreflects the current wear count associated with the memory block.

In step 308, the memory controller 106 can update the wear count tableto reflect the detected GC operation. To this end, the memory controller106 can (1) determine a first wear count element in the wear count table200 corresponding to the previous wear count of the memory block and (2)determine a second wear count element in the wear count table 200corresponding to the current wear count of the memory block.

If the first wear count element and the second wear count element arethe same (e.g., the previous wear count was 100; the current wear countis 101; and a single wear count element in the wear count table 200corresponds to wear counts between 50 and 150,) then the memorycontroller 106 can revert back to step 304 without updating the wearcount table.

If the first wear count element and the second wear count element aredifferent, then the memory controller 106 can decrease, by one, thevalue associated with the first wear count element, and increase, byone, the value associated with the second wear count element. This way,the wear count table 200 can accurately reflect the distribution of wearcounts amongst the memory blocks 110.

In some embodiments, when a wear count element corresponding to thesmallest wear count is associated with less than p % of memory blocks,then the memory controller 106 can merge that wear count element withthe next-smallest wear count element. For example, referring back toFIG. 2, when p=5, then the number of memory blocks corresponding thesmallest wear count element 202A is less than p % of the memory blocks.In this case, the memory controller 106 can merge the smallest wearcount element 202A with another wear count element 202B corresponding tothe next smallest wear count (or the next smallest range of wearcounts.) When the wear count table 200 is T, and the wear count elementsin the table T is identified using an index i, i=0 . . . 2, then themerging operation can be represented using the following pseudo code:

If T[0] is associated with less than p% of memory blocks: T[0] = T[0] +T[1]; T[1] = T[2]; End

When the memory controller 106 receives a GC operation request, thememory controller 106 can select a memory block that is associated witha wear count within the bottom p % of all wear counts. This way, thememory controller 106 can level the wear across memory blocks.

FIG. 4 illustrates a process for selecting a memory block for a GCoperation in accordance with some embodiments. In step 402, the memorycontroller 106 can select a memory block 110 amongst the memory blocksin the storage system 104. In step 404, the memory controller 106 candetermine the wear count associated with the selected memory block. Insome embodiments, the memory controller 106 can determine the wear countby retrieving the wear count associated with the selected memory blockfrom a wear count map.

In step 406, the memory controller 106 can determine whether the wearcount of the selected memory block is within the bottom p % of all wearcounts. In some embodiments, the memory controller 106 can make thisdetermination by determining whether the wear count of the selectedmemory block is associated with the smallest wear count element (e.g., awear count element corresponding to the smallest wear count) in the wearcount table 200.

When the wear count of the selected memory block is within the bottom p% of all wear counts, the memory controller 106 can move to step 408 andperform a GC operation on the selected memory block. When the wear countof the selected memory block is not within the bottom p % of all wearcounts, then the memory controller 106 can move to step 402 and iteratesteps 402-406 until the memory controller 106 identifies a memory blockwhose the wear count is within the bottom p % of all wear counts. Thisway, the memory controller 106 can wear-level memory blocks having awear count in the upper (100−p)% of all wear counts.

In some embodiments, the memory controller can be configured to limitthe number of iterations for identifying a memory block whose the wearcount is within the bottom p % of all wear counts. This way, the memorycontroller does not stall the GC operation indefinitely, especially whenthe value of p is low. In some embodiments, when the memory controllerfails to identify a memory block within the number of iterations, thememory controller can randomly select a memory block for the garbagecollection.

When the value of p is small, then a large portion of memory blocks canbe wear-leveled since memory blocks having a wear count in the upper(100−p)% are wear-leveled. However, a small value of p would likelyincrease the number of iterations needed to identify a memory blockwhose the wear count is within the bottom p % of all wear counts.Therefore, p is an important parameter for the operation of thedisclosed wear-leveling technique. In some embodiments, p can be equalto 1.

FIG. 5 illustrates a probability of identifying a memory block having awear count within the bottom p % of all wear counts in accordance withsome embodiments. This figure illustrates a scenario in which thestorage system 104 includes 256 Tera-Bytes of memory, each memory blockincludes 128 Kilo-Bytes of memory, and p=1. The probability ofidentifying a memory block having a wear count within the bottom p % ofall wear counts increases as a function of iteration. The probability ofidentifying the memory block is greater than 99% when the memorycontroller 106 iterates for more than 500 iterations.

A memory block selected for a GC operation may still maintain validpages. In order to perform a GC operation on such a memory block, thememory controller 106 should retrieve the valid pages and store theretrieved pages in a new memory block. Because the memory controller 106is unnecessarily moving valid pages between memory blocks, the memorycontroller 106 is in effect performing unnecessary write operations.Such unnecessary write operations are often characterized as writeamplification.

To reduce write amplification, the memory controller 106 can beconfigured to select a memory block that has less number of valid pages.To this end, the memory controller 106 can be configured to reduce thewear count of a memory block by a downgrade step M when the number ofinvalid pages in the memory block is large. The downgrade step M can beany positive integer. This way, the memory controller 106 is steered toselect a memory block that has a large number of invalid pages, inaddition to having a wear count that is smaller compared to other memoryblocks. When this memory block is selected for the GC operation, thememory controller 106 can increase the wear count of this memory blockby (1+M). In some embodiments, the value of the downgrade step M candepend on the number of invalid pages in the memory block.

Where reference is made herein to a method comprising two or moredefined steps, the defined steps can be carried out in any order orsimultaneously (except where the context would indicate otherwise), andthe method can include one or more other steps which are carried outbefore any of the defined steps, between two of the defined steps, orafter all the defined steps (except where the context would indicateotherwise).

Those of skill in the art would appreciate that various illustrationsdescribed herein may be implemented as electronic hardware, computersoftware, firmware, or combinations of two or more of electronichardware, computer software, and firmware. To illustrate thisinterchangeability of hardware, software, and/or firmware, variousillustrative blocks, modules, elements, components, methods, andalgorithms have been described above generally in terms of theirfunctionality. Whether such functionality is implemented as hardware,software, firmware, or a combination depends upon the particularapplication and design constraints imposed on the overall system.Skilled artisans may implement the described functionality in varyingways for each particular application. Various components and blocks maybe arranged differently (for example, arranged in a different order, orpartitioned in a different way) all without departing from the scope ofthe subject technology. An implementation of the disclosed subjectmatter can be realized in a centralized fashion in one computer system,or in a distributed fashion where different elements are spread acrossseveral interconnected computer systems. Any kind of computer system, orother apparatus adapted for carrying out the methods described herein,is suited to perform the functions described herein.

A typical combination of hardware and software could be a generalpurpose computer system with a computer program that, when being loadedand executed, controls the computer system such that it carries out themethods described herein. The disclosed subject matter can also beembedded in a computer program product, which comprises all the featuresenabling the implementation of the methods and systems described herein,and which, when loaded in a computer system is able to carry out thesemethods.

Computer program or application in the present context means anyexpression, in any language, code or notation, of a set of instructionsintended to cause a system having an information processing capabilityto perform a particular function either directly or after either or bothof the following a) conversion to another language, code or notation; b)reproduction in a different material form. Significantly, the systemsand methods described herein may also be embodied in other specificforms without departing from the spirit or essential attributes thereof,and accordingly, reference should be had to the following claims, ratherthan to the foregoing specification, as indicating the scope of thesystems and methods.

The present disclosure has been described in detail with specificreference to these illustrated embodiments. It will be apparent,however, that various modifications and changes can be made within thespirit and scope of the disclosure as described in the foregoingspecification, and such modifications and changes are to be consideredequivalents and part of this disclosure.

1. A method comprising: receiving, at a memory controller in a storagesystem, a request to delete data from the storage system; determining awear count value associated with a memory block among a plurality ofmemory blocks of the storage system; determining whether the wear countvalue associated with the memory block satisfies a threshold wear countvalue; and in response to determining that the wear count valueassociated with the memory block satisfies the threshold wear countvalue: causing, by the memory controller, deletion of data from thememory block.
 2. The method of claim 1, further comprising in responseto determining that the wear count value associated with the memoryblock does not satisfy the threshold wear count value: selecting asecond memory block from the plurality of memory blocks of the storagesystem; determining, by the memory controller, whether a wear countvalue associated with the second memory block satisfies the thresholdwear count value; and in response to determining that the wear countvalue associated with the second memory block satisfies the thresholdwear count value, causing, by the memory controller, deletion of datafrom the second memory block.
 3. The method of claim 1, furthercomprising: in response to determining that the wear count valueassociated with the memory block does not satisfy the threshold wearcount value: determining, by the memory controller, whether a countersatisfies a threshold number of attempts to identify a memory blockassociated with a wear count value that satisfies the threshold wearcount value; in response to determining that the counter satisfies thethreshold number of attempts: selecting randomly, by the memorycontroller, a second memory block from the plurality of memory blocks ofthe storage system; and causing, by the memory controller, deletion ofdata from the second memory block.
 4. The method of claim 1, furthercomprising: updating the wear count value associated with the memoryblock to an updated wear count value.
 5. The method of claim 4, furthercomprising: updating, by the memory controller, the wear count valueassociated with the memory block to the updated wear count value byincreasing the wear count value.
 6. The method of claim 4, furthercomprising: identifying, by the memory controller, based on the wearcount value, a first wear count element in a data structure;identifying, by the memory controller, based on the updated wear countvalue, a second wear count element in the data structure; determining,by the memory controller, whether the first wear count element and thesecond wear count element are different; and in response to determiningthat the first wear count element and the second wear count element aredifferent: updating, by the memory controller, based on the updated wearcount value, the data structure.
 7. The method of claim 6, wherein thefirst wear count element is associated with a first range of wear countvalues and a first number of memory blocks among the plurality of memoryblocks of the storage system, and wherein the second wear count elementis associated with a second range of wear count values and a secondnumber of memory blocks among the plurality of memory blocks of thestorage system.
 8. The method of claim 7, wherein the wear count valueis within the first range of wear count values, and the updated wearcount value is within the second range of wear count values.
 9. Themethod of claim 7, further comprising: updating the data structure bydecreasing the first number of memory blocks associated with the firstwear count element, and increasing the second number of memory blocksassociated with the second wear count element.
 10. A storage systemcomprising: a plurality of memory blocks; and a memory controller;wherein the memory controller is configured to: receive a request todelete data from the storage system; determine a wear count valueassociated with a memory block among a plurality of memory blocks of thestorage system; determine whether the wear count value associated withthe memory block satisfies a threshold wear count value; and when thewear count value is determined to be associated with the memory blocksatisfies the threshold wear count value, update the wear count valueassociated with the memory block to an updated wear count value, andcause deletion of data from the memory block.
 11. The storage system ofclaim 10, wherein the memory controller is configured to: in response todetermining that the wear count value associated with the memory blockdoes not satisfy the threshold wear count value: select a second memoryblock from the plurality of memory blocks; determine whether a wearcount value associated with the second memory block satisfies thethreshold wear count value; and in response to determining that the wearcount value associated with the second memory block satisfies thethreshold wear count value: cause deletion of data from the secondmemory block.
 12. The storage system of claim 10, wherein the memorycontroller is configured to: in response to determining that the wearcount value associated with the memory block does not satisfy thethreshold wear count value: determine whether a counter satisfies athreshold number of attempts to identify a memory block associated witha wear count value that satisfies the threshold wear count value; and inresponse to determining that the counter satisfies the threshold numberof attempts: select a second memory block from the plurality of memoryblocks; and cause deletion of data from the second memory block.
 13. Thestorage system of claim 10, wherein the memory controller is configuredto increase the wear count value to update the wear count value to theupdated wear count value.
 14. The storage system of claim 10, whereinthe memory controller is configured to: identify, based on the wearcount value, a first wear count element in a data structure; identify,based on the updated wear count value, a second wear count element inthe data structure; determine whether the first wear count element andthe second wear count element are different; and in response todetermining that the first wear count element and the second wear countelement are different, update the data structure.
 15. The storage systemof claim 14, wherein the first wear count element is associated with afirst one or more wear count values and a first number of memory blocksamong the plurality of memory blocks of the storage system, and whereinthe second wear count element is associated with a second one or morewear count values and a second number of memory blocks among theplurality of memory blocks.
 16. The storage system of claim 15, whereinthe wear count value is one of the first one or more wear count values,and the updated wear count value is one of the second one or more wearcount values.
 17. The storage system of claim 15, wherein the memorycontroller is configured to: decrease the first number of memory blocksassociated with the first wear count element, and increase the secondnumber of memory blocks associated with the second wear count element,to update the data structure.
 18. A system comprising: means forreceiving a request to delete data from a storage system; means fordetermining a wear count value associated with a memory block among aplurality of memory blocks of the storage system; means for determiningwhether the wear count value associated with the memory block satisfiesa threshold wear count value; in response to determining that the wearcount value associated with the memory block satisfies the thresholdwear count value: means for updating the wear count value associatedwith the memory block to an updated wear count value by increasing thewear count value; and means for causing deletion of data from the memoryblock.
 19. The system of claim 18, further comprising: in response todetermining that the wear count value associated with the memory blockdoes not satisfy the threshold wear count value: means for determiningwhether a counter satisfies a threshold number of attempts to identify amemory block associated with a wear count value that satisfies thethreshold wear count value; and in response to determining that thecounter satisfies the threshold number of attempts: means for selectingrandomly a second memory block from the plurality of memory blocks ofthe storage system; and means for causing deletion of data from thesecond memory block.
 20. A non-transitory machine-readable mediumincluding machine-executable instructions thereon that, when executed bya processor, perform a method comprising: receiving a request to deletedata from a storage system; determining a wear count value associatedwith a memory block among a plurality of memory blocks of the storagesystem; determining whether the wear count value associated with thememory block satisfies a threshold wear count value; and in response todetermining that the wear count value associated with the memory blocksatisfies the threshold wear count value: causing deletion of data fromthe memory block; in response to determining that the wear count valueassociated with the memory block does not satisfy the threshold wearcount value: determining whether a counter satisfies a threshold numberof attempts to identify a memory block associated with a wear count thatsatisfies the threshold wear count value; and in response to determiningthat the counter satisfies the threshold number of attempts: selectingrandomly a second memory block from the plurality of memory blocks ofthe storage system; and causing deletion of data from the second memoryblock.